package com.xw.service;

import com.xw.common.Const;
import com.xw.dao.CityDicAreaMapper;
import com.xw.model.CityDicArea;
import com.xw.util.JsonData;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @需求描述:
 * @创建人:whh
 * @创建时间: 2019/11/26
 * @修改需求:
 * @修改人:
 * @修改时间:
 * @需求思路:
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class CityDicAreaServiceImpl implements CityDicAreaService {

    @Resource
    private CityDicAreaMapper cityDicAreaMapper;


    @Override
    public Map findCityDicArea(String areaName,Integer pid , Integer level) {
        CityDicArea cityDicArea = new CityDicArea();
        cityDicArea.setAreaName(areaName);
        cityDicArea.setPid(pid);
        cityDicArea.setLevel(level);
        List<CityDicArea> cityDicAreaList = cityDicAreaMapper.select(cityDicArea);
        return JsonData.success(cityDicAreaList, Const.OPREATE_MSG_SUCCESS);
    }
}
